<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
	<head>

		<title>班级查询</title>
		<!-- Bootstrap core CSS -->
		<link href="../static/asserts/css/bootstrap.min.css" th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">
		<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.js"></script>
		<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.css" rel="stylesheet">
		<!-- Custom styles for this template -->
		<link href="../static/asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
		<style type="text/css">
			/* Chart.js */

			@-webkit-keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}

			@keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}

			.chartjs-render-monitor {
				-webkit-animation: chartjs-render-animation 0.001s;
				animation: chartjs-render-animation 0.001s;
			}
		</style>
	</head>

	<body>
<div th:replace="sidbar::#topbar"></div>

		<div class="container-fluid">
			<div class="row">
				<div th:replace="sidbar::#sbar(activeUri='main.html')"></div>

				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<div class="chartjs-size-monitor" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;">
						<div class="chartjs-size-monitor-expand" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
							<div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div>
						</div>
						<div class="chartjs-size-monitor-shrink" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
							<div style="position:absolute;width:200%;height:200%;left:0; top:0"></div>
						</div>
					</div>

					<div class="row">
						<div class="col-md-2 ">
							<a th:href="@{/toAddCla}" class="btn btn-warning">添加班级</a>
						</div>
						<div class="col-md-2 col-md-offset-1">
							<a th:href="@{/selectACla}" class="btn btn-info">查看全部班级</a>
						</div>
						<div class="col-md-6 col-md-offset-1">
							<form th:action="@{/selectClaByName}" method="post">
								班级名字：<input type="text" name="name">
								<input type="submit" value="查询" class="btn btn-success">
							</form>
						</div>

					</div>
					<div th:if="${bj!=null}" style="font-size: large;text-align: center;border: 1px gray solid;background: #d2ffa9">
						[[${bj}]]成功！班级信息： <br>
						<div th:text="'班级id：'+${classes.getId()}"></div> <br>
						<div  th:text="'班级名字：'+${classes.getName()}">
						</div>
					</div>
					<div id="bodyy" th:if="${bj==null}">
						<!--                    <button id="btn" th:onclick="stu(1)">bb</button>-->

						<table class="table table-bordered">
							<h>班级的操作 </h>
							<thead>
							<tr>
								<th>班级id</th>
								<th>班级名字</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							<tr th:each="its:${pageInfo.list}" th:if="${its.getId()!=100}">
								<td th:text="${its.getId()}">编号</td>
								<td ><a class="btn btn-outline-primary"  th:href="@{/selStuByCid(id=${its.getId()})}" th:text="${its.getName()}"></a>  </td>
								<td class="warning" >
										<a   class="btn btn-outline-danger" th:href="@{/deleteCla(cid=${its.getId()})}" title="注意!!此操作会附带删除这个班的学生">删除班级</a>
								</td>
							</tr>
							</tbody>
						</table>

						<div class="col-md-2">
							当前[[${pageInfo.pageNum}]]页,总共[[${pageInfo.pages}]]页,总[[${pageInfo.total}]]条记录
						</div>

						<!--						查询全部班级-->
						<nav th:if="${type=='all'}"  aria-label="Page navigation"  style="text-align: center">
							<ul class="pagination pagination-lg">
								<li>
									<a th:href="@{/selectACla(pageNum=1)}" aria-label="Next">
										<span aria-hidden="true">首页</span>
									</a>
								</li>
								<li>
									<a th:href="@{/selectACla(pageNum=${pageInfo.pageNum -1})}" aria-label="Next">
										<span aria-hidden="true">&laquo;</span>
									</a>
								</li>
							</ul>
							<ul class="pagination pagination-lg" th:each="na:${pageInfo.navigatepageNums}">
								<li><a th:href="@{/selectACla(pageNum=${na})}" th:if="${pageInfo.pageNum!=na}"
									   th:text="${na}"></a></li>
								<li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfo.pageNum==na}"
														 th:text="${na}"></a></li>
							</ul>
							<ul class="pagination pagination-lg">
								<li>
									<a th:href="@{/selectACla(pageNum=${pageInfo.pageNum +1})}" aria-label="Next">
										<span aria-hidden="true">&raquo;</span>
									</a>
								</li>
								<li>
									<a th:href="@{/selectACla(pageNum=${pageInfo.pages})}" aria-label="Next">
										<span aria-hidden="true">末页</span>
									</a>
								</li>
							</ul>
						</nav>


						<!--						根据查询班级-->
						<nav th:if="${type=='name'}" aria-label="Page navigation"  style="text-align: center">
							<ul class="pagination pagination-lg">
								<li>
									<a th:href="@{/selectClaByName(name=${name},pageNum=1)}" aria-label="Next">
										<span aria-hidden="true">首页</span>
									</a>
								</li>
								<li>
									<a th:href="@{/selectClaByName(name=${name},pageNum=${pageInfo.pageNum -1})}" aria-label="Next">
										<span aria-hidden="true">&laquo;</span>
									</a>
								</li>
							</ul>
							<ul class="pagination pagination-lg" th:each="na:${pageInfo.navigatepageNums}">
								<li><a th:href="@{/selectClaByName(name=${name},pageNum=${na})}" th:if="${pageInfo.pageNum!=na}"
									   th:text="${na}"></a></li>
								<li th:class="active"><a th:class="active" th:href="@{#}" th:if="${pageInfo.pageNum==na}"
														 th:text="${na}"></a></li>
							</ul>
							<ul class="pagination pagination-lg">
								<li>
									<a th:href="@{/selectClaByName(name=${name},pageNum=${pageInfo.pageNum +1})}" aria-label="Next">
										<span aria-hidden="true">&raquo;</span>
									</a>
								</li>
								<li>
									<a th:href="@{/selectClaByName(name=${name},pageNum=${pageInfo.pages})}" aria-label="Next">
										<span aria-hidden="true">末页</span>
									</a>
								</li>
							</ul>
						</nav>
					</div>

				</main>
			</div>
		</div>


	</body>

</html>